//6：如果斐波拉切数列的前N项，N由用户输入。
//斐波拉切数列的定义是前两个是1，后面的每一个是前面的两个和，比如N是5,则输出结果是1,1,2,3,5
public class Task1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("please input a number N:");
        int N = input.nextInt(), i, temp = 1, sum = 0;
        if (N % 2 != 0) {
            System.out.println(temp + ",");
            for (i = 1; i <= N / 2; i++) {
                sum = temp + sum;//第2,4,6，，，个数
                temp = sum + temp;//第3,5,7，，，个数
                System.out.println(sum + "," + temp + ",");
            }
        }
        if (N % 2 == 0) {
            for (i = 1; i <= N / 2; i++) {
                temp = sum + temp;//第1,3,5，，，个数
                sum = temp + sum;//第2,4,6，，，个数
                System.out.println(temp + "," + sum + ",");
            }
        }
    }
}